﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp2
{
    class Operation
    {
        protected int[] arr;
        public virtual int Run() { return 0; }
        public virtual int[] Input() {
            arr = new int[2];
            Console.WriteLine("请输入第一个数字");
            arr[0] = int.Parse(Console.ReadLine());
            Console.WriteLine("请输入第二个数字");
            arr[1] = int.Parse(Console.ReadLine());
            return arr;
        }
    }

    class Add : Operation
    {
        public override int Run()
        {
            base.arr = Input();
            return arr[0] + arr[1];
        }

        
    }
    class Reduce : Operation
    {
        public override int Run()
        {
            base.arr = Input();
            return arr[0] - arr[1];
        }
    }

    class Multiply : Operation
    {
        public override int Run() {
            base.arr = Input();
            return arr[0] * arr[1];
        }
    }

    class Division : Operation
    {
        public override int Run()
        {
            base.arr = Input();
            return arr[0] / arr[1];
        }
    }
}
